package shape;

public class Circle extends Shape{
    private double r;
    public final static double PI =3.1415926;

    static {
        System.out.println("圆类被调用的第一行代码: 注册 链接数据库 ...");
    }
    public Circle(double r) {
        this.r = r;
    }
    @Override // @开头的 Java注解   Override 重写操作
    public void calcArea(){
        area = Math.PI * r * r;
        System.out.println("面积 Area ："+area);
    }
}
